export default {
  namespaced: true,
  state: {
    item: ['香蕉', '苹果', '橘子']
  },
  mutations: {
    add_item: (state, n) => {
      state.item.push(n)
    },
    change_item: (state, n) => {
      // state.item[2] = n
      state.item.push(n)
      console.log(1)
    }
  },
  getters: {
    change: state => {
      return state.item[1]
    }
  },
  actions: {
    gai (context, n) {
      context.commit('change_item', n)
    }
  }
}
